\documentclass[a4paper,11pt]{book}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{natbib}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{url}
\usepackage{float}
\usepackage{subfig}
\usepackage{appendix}
\usepackage[disable]{todonotes}
\usepackage{parskip}
\usepackage{url}
\usepackage{fancyhdr}
\usepackage{rotating}
\usepackage{amsthm}
\usepackage{pdfsync}
\usepackage{epigraph}
\newtheorem{mydef}{Definition}

%info
\newcommand{\thesisAuthor}{Espen Auran Rathe and J\o rgen B\o e Svendsen}
\newcommand{\thesisTitle}{Micromanagement in StarCraft using Potential Fields tuned with a Multi-Objective Genetic Algorithm}
\newcommand{\thesisType}{Master thesis}
\newcommand{\thesisDate}{Spring 2012}

% PDF info
\hypersetup{linkcolor=black}
\hypersetup{citecolor=black}
\hypersetup{urlcolor=black}

% Set equal margins on book style
\setlength{\oddsidemargin}{53pt}
\setlength{\evensidemargin}{53pt}
\setlength{\marginparwidth}{57pt}
\setlength{\footskip}{30pt}

%Fancyheaders
%Redefine plain page style
\fancypagestyle{plain}{
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[LE,RO]{\thepage}
}
% Code for creating empty pages
% No headers on empty pages before new chapter
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
    \hbox{}
    \thispagestyle{plain}
    \newpage
    \if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother \clearpage{\pagestyle{plain}\cleardoublepage}

% Define pagestyle
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\chaptermark}[1]{\markboth{ \emph{#1}}{}}
\fancyhead[LO]{}
\fancyhead[RE]{\leftmark}
\fancyfoot[LE,RO]{\thepage}

% Citation format
\bibliographystyle{apalike}
\bibpunct{(}{)}{;}{a}{,}{,}

\floatstyle{boxed}

\begin{document}
\include{titlepage}
\listoftodos
\include{frontmatter}

\mainmatter
\fancyhead[LO]{\leftmark}
\fancyhead[RE]{\emph{Chapter \thechapter}}
\include{parts/introduction}
\include{parts/theory_methodology}
\include{parts/domain_mechanics}
\include{parts/related_work}
\include{parts/tools_framework}
\include{parts/model}
\include{parts/experiment}
\include{parts/conclusion}

\include{appendix_a}
\backmatter
\addcontentsline{toc}{chapter}{Bibliography}
\bibliography{bibtex/references}

\end{document}